package com.demo.common.config;

import jakarta.annotation.PostConstruct;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import com.demo.common.util.DemoUtil;
import com.demo.common.util.httpclient.HttpExecutor;
import com.demo.common.util.httpclient.HttpExecutorBuilder;

import lombok.extern.slf4j.Slf4j;

/**
 * InitConfig
 * 
 * @author demo
 * @data 2020-12-01 14:35:12
 */
@Slf4j
@Configuration
public class InitCommonConfig {

    @PostConstruct
    public void init() {
        DemoUtil.setDesKey("ABCabc123_321$");
        log.info("{} inited", InitCommonConfig.class.getSimpleName());
    }

    @Primary
    @Bean
    public HttpExecutor httpExecutor() {
        return HttpExecutorBuilder.custom().build();
    }

}
